﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ThoughtWorks.QRCode.Codec;

public class QRVerToDataSize
{
    public int Version { get; set; }
    public QRCodeEncoder.ERROR_CORRECTION ErrorCorrect { get; set; }
    public int Numeric { get; set; }
    public int AlphaNumeric { get; set; }
    public int Byte { get; set; }

    public static IEnumerable<QRVerToDataSize> Table { get; protected set; }

    protected QRVerToDataSize(int version,
            QRCodeEncoder.ERROR_CORRECTION errorCorrect,
            int numeric,
            int alphaNumeric,
            int @byte)
    {
        Version = version;
        ErrorCorrect = errorCorrect;
        Numeric = numeric;
        AlphaNumeric = alphaNumeric;
        Byte = @byte;
    }

    static QRVerToDataSize()
    {
        #region Table = new QRVerToDataSize[]{...}
        Table = new QRVerToDataSize[]{
            new QRVerToDataSize(1, QRCodeEncoder.ERROR_CORRECTION.L, 41, 25, 17),
            new QRVerToDataSize(1, QRCodeEncoder.ERROR_CORRECTION.M, 34, 20, 14),
            new QRVerToDataSize(1, QRCodeEncoder.ERROR_CORRECTION.Q, 27, 16, 11),
            new QRVerToDataSize(1, QRCodeEncoder.ERROR_CORRECTION.H, 17, 10, 7),
            new QRVerToDataSize(2, QRCodeEncoder.ERROR_CORRECTION.L, 77, 47, 32),
            new QRVerToDataSize(2, QRCodeEncoder.ERROR_CORRECTION.M, 63, 38, 26),
            new QRVerToDataSize(2, QRCodeEncoder.ERROR_CORRECTION.Q, 48, 29, 20),
            new QRVerToDataSize(2, QRCodeEncoder.ERROR_CORRECTION.H, 34, 20, 14),
            new QRVerToDataSize(3, QRCodeEncoder.ERROR_CORRECTION.L, 127, 77, 53),
            new QRVerToDataSize(3, QRCodeEncoder.ERROR_CORRECTION.M, 101, 61, 42),
            new QRVerToDataSize(3, QRCodeEncoder.ERROR_CORRECTION.Q, 77, 47, 32),
            new QRVerToDataSize(3, QRCodeEncoder.ERROR_CORRECTION.H, 58, 35, 24),
            new QRVerToDataSize(4, QRCodeEncoder.ERROR_CORRECTION.L, 187, 114, 78),
            new QRVerToDataSize(4, QRCodeEncoder.ERROR_CORRECTION.M, 149, 90, 62),
            new QRVerToDataSize(4, QRCodeEncoder.ERROR_CORRECTION.Q, 111, 67, 46),
            new QRVerToDataSize(4, QRCodeEncoder.ERROR_CORRECTION.H, 82, 50, 34),
            new QRVerToDataSize(5, QRCodeEncoder.ERROR_CORRECTION.L, 255, 154, 106),
            new QRVerToDataSize(5, QRCodeEncoder.ERROR_CORRECTION.M, 202, 122, 84),
            new QRVerToDataSize(5, QRCodeEncoder.ERROR_CORRECTION.Q, 144, 87, 60),
            new QRVerToDataSize(5, QRCodeEncoder.ERROR_CORRECTION.H, 106, 64, 44),
            new QRVerToDataSize(6, QRCodeEncoder.ERROR_CORRECTION.L, 322, 195, 134),
            new QRVerToDataSize(6, QRCodeEncoder.ERROR_CORRECTION.M, 255, 154, 106),
            new QRVerToDataSize(6, QRCodeEncoder.ERROR_CORRECTION.Q, 178, 108, 74),
            new QRVerToDataSize(6, QRCodeEncoder.ERROR_CORRECTION.H, 139, 84, 58),
            new QRVerToDataSize(7, QRCodeEncoder.ERROR_CORRECTION.L, 370, 224, 154),
            new QRVerToDataSize(7, QRCodeEncoder.ERROR_CORRECTION.M, 293, 178, 122),
            new QRVerToDataSize(7, QRCodeEncoder.ERROR_CORRECTION.Q, 207, 125, 86),
            new QRVerToDataSize(7, QRCodeEncoder.ERROR_CORRECTION.H, 154, 93, 64),
            new QRVerToDataSize(8, QRCodeEncoder.ERROR_CORRECTION.L, 461, 279, 192),
            new QRVerToDataSize(8, QRCodeEncoder.ERROR_CORRECTION.M, 365, 221, 152),
            new QRVerToDataSize(8, QRCodeEncoder.ERROR_CORRECTION.Q, 259, 157, 108),
            new QRVerToDataSize(8, QRCodeEncoder.ERROR_CORRECTION.H, 202, 122, 84),
            new QRVerToDataSize(9, QRCodeEncoder.ERROR_CORRECTION.L, 552, 335, 230),
            new QRVerToDataSize(9, QRCodeEncoder.ERROR_CORRECTION.M, 432, 262, 180),
            new QRVerToDataSize(9, QRCodeEncoder.ERROR_CORRECTION.Q, 312, 189, 130),
            new QRVerToDataSize(9, QRCodeEncoder.ERROR_CORRECTION.H, 235, 143, 98),
            new QRVerToDataSize(10, QRCodeEncoder.ERROR_CORRECTION.L, 652, 395, 271),
            new QRVerToDataSize(10, QRCodeEncoder.ERROR_CORRECTION.M, 513, 311, 213),
            new QRVerToDataSize(10, QRCodeEncoder.ERROR_CORRECTION.Q, 364, 221, 151),
            new QRVerToDataSize(10, QRCodeEncoder.ERROR_CORRECTION.H, 288, 174, 119),
            new QRVerToDataSize(11, QRCodeEncoder.ERROR_CORRECTION.L, 772, 468, 321),
            new QRVerToDataSize(11, QRCodeEncoder.ERROR_CORRECTION.M, 604, 366, 251),
            new QRVerToDataSize(11, QRCodeEncoder.ERROR_CORRECTION.Q, 427, 259, 177),
            new QRVerToDataSize(11, QRCodeEncoder.ERROR_CORRECTION.H, 331, 200, 137),
            new QRVerToDataSize(12, QRCodeEncoder.ERROR_CORRECTION.L, 883, 535, 367),
            new QRVerToDataSize(12, QRCodeEncoder.ERROR_CORRECTION.M, 691, 419, 287),
            new QRVerToDataSize(12, QRCodeEncoder.ERROR_CORRECTION.Q, 489, 296, 203),
            new QRVerToDataSize(12, QRCodeEncoder.ERROR_CORRECTION.H, 374, 227, 155),
            new QRVerToDataSize(13, QRCodeEncoder.ERROR_CORRECTION.L, 1022, 619, 425),
            new QRVerToDataSize(13, QRCodeEncoder.ERROR_CORRECTION.M, 796, 483, 331),
            new QRVerToDataSize(13, QRCodeEncoder.ERROR_CORRECTION.Q, 580, 352, 241),
            new QRVerToDataSize(13, QRCodeEncoder.ERROR_CORRECTION.H, 427, 259, 177),
            new QRVerToDataSize(14, QRCodeEncoder.ERROR_CORRECTION.L, 1101, 667, 458),
            new QRVerToDataSize(14, QRCodeEncoder.ERROR_CORRECTION.M, 871, 528, 362),
            new QRVerToDataSize(14, QRCodeEncoder.ERROR_CORRECTION.Q, 621, 376, 258),
            new QRVerToDataSize(14, QRCodeEncoder.ERROR_CORRECTION.H, 468, 283, 194),
            new QRVerToDataSize(15, QRCodeEncoder.ERROR_CORRECTION.L, 1250, 758, 520),
            new QRVerToDataSize(15, QRCodeEncoder.ERROR_CORRECTION.M, 991, 600, 412),
            new QRVerToDataSize(15, QRCodeEncoder.ERROR_CORRECTION.Q, 703, 426, 292),
            new QRVerToDataSize(15, QRCodeEncoder.ERROR_CORRECTION.H, 530, 321, 220),
            new QRVerToDataSize(16, QRCodeEncoder.ERROR_CORRECTION.L, 1408, 854, 586),
            new QRVerToDataSize(16, QRCodeEncoder.ERROR_CORRECTION.M, 1082, 656, 450),
            new QRVerToDataSize(16, QRCodeEncoder.ERROR_CORRECTION.Q, 775, 470, 322),
            new QRVerToDataSize(16, QRCodeEncoder.ERROR_CORRECTION.H, 602, 365, 250),
            new QRVerToDataSize(17, QRCodeEncoder.ERROR_CORRECTION.L, 1548, 938, 644),
            new QRVerToDataSize(17, QRCodeEncoder.ERROR_CORRECTION.M, 1212, 734, 504),
            new QRVerToDataSize(17, QRCodeEncoder.ERROR_CORRECTION.Q, 876, 531, 364),
            new QRVerToDataSize(17, QRCodeEncoder.ERROR_CORRECTION.H, 674, 408, 280),
            new QRVerToDataSize(18, QRCodeEncoder.ERROR_CORRECTION.L, 1725, 1046, 718),
            new QRVerToDataSize(18, QRCodeEncoder.ERROR_CORRECTION.M, 1346, 816, 560),
            new QRVerToDataSize(18, QRCodeEncoder.ERROR_CORRECTION.Q, 948, 574, 394),
            new QRVerToDataSize(18, QRCodeEncoder.ERROR_CORRECTION.H, 746, 452, 310),
            new QRVerToDataSize(19, QRCodeEncoder.ERROR_CORRECTION.L, 1903, 1153, 792),
            new QRVerToDataSize(19, QRCodeEncoder.ERROR_CORRECTION.M, 1500, 909, 624),
            new QRVerToDataSize(19, QRCodeEncoder.ERROR_CORRECTION.Q, 1063, 644, 442),
            new QRVerToDataSize(19, QRCodeEncoder.ERROR_CORRECTION.H, 813, 493, 338),
            new QRVerToDataSize(20, QRCodeEncoder.ERROR_CORRECTION.L, 2061, 1249, 858),
            new QRVerToDataSize(20, QRCodeEncoder.ERROR_CORRECTION.M, 1600, 970, 666),
            new QRVerToDataSize(20, QRCodeEncoder.ERROR_CORRECTION.Q, 1159, 702, 482),
            new QRVerToDataSize(20, QRCodeEncoder.ERROR_CORRECTION.H, 919, 557, 382),
            new QRVerToDataSize(21, QRCodeEncoder.ERROR_CORRECTION.L, 2232, 1352, 929),
            new QRVerToDataSize(21, QRCodeEncoder.ERROR_CORRECTION.M, 1708, 1035, 711),
            new QRVerToDataSize(21, QRCodeEncoder.ERROR_CORRECTION.Q, 1224, 742, 509),
            new QRVerToDataSize(21, QRCodeEncoder.ERROR_CORRECTION.H, 969, 587, 403),
            new QRVerToDataSize(22, QRCodeEncoder.ERROR_CORRECTION.L, 2409, 1460, 1003),
            new QRVerToDataSize(22, QRCodeEncoder.ERROR_CORRECTION.M, 1872, 1134, 779),
            new QRVerToDataSize(22, QRCodeEncoder.ERROR_CORRECTION.Q, 1358, 823, 565),
            new QRVerToDataSize(22, QRCodeEncoder.ERROR_CORRECTION.H, 1056, 640, 439),
            new QRVerToDataSize(23, QRCodeEncoder.ERROR_CORRECTION.L, 2620, 1588, 1091),
            new QRVerToDataSize(23, QRCodeEncoder.ERROR_CORRECTION.M, 2059, 1248, 857),
            new QRVerToDataSize(23, QRCodeEncoder.ERROR_CORRECTION.Q, 1468, 890, 611),
            new QRVerToDataSize(23, QRCodeEncoder.ERROR_CORRECTION.H, 1108, 672, 461),
            new QRVerToDataSize(24, QRCodeEncoder.ERROR_CORRECTION.L, 2812, 1704, 1171),
            new QRVerToDataSize(24, QRCodeEncoder.ERROR_CORRECTION.M, 2188, 1326, 911),
            new QRVerToDataSize(24, QRCodeEncoder.ERROR_CORRECTION.Q, 1588, 963, 661),
            new QRVerToDataSize(24, QRCodeEncoder.ERROR_CORRECTION.H, 1228, 744, 511),
            new QRVerToDataSize(25, QRCodeEncoder.ERROR_CORRECTION.L, 3057, 1853, 1273),
            new QRVerToDataSize(25, QRCodeEncoder.ERROR_CORRECTION.M, 2395, 1451, 997),
            new QRVerToDataSize(25, QRCodeEncoder.ERROR_CORRECTION.Q, 1718, 1041, 715),
            new QRVerToDataSize(25, QRCodeEncoder.ERROR_CORRECTION.H, 1286, 779, 535),
            new QRVerToDataSize(26, QRCodeEncoder.ERROR_CORRECTION.L, 3283, 1990, 1367),
            new QRVerToDataSize(26, QRCodeEncoder.ERROR_CORRECTION.M, 2544, 1542, 1059),
            new QRVerToDataSize(26, QRCodeEncoder.ERROR_CORRECTION.Q, 1804, 1094, 751),
            new QRVerToDataSize(26, QRCodeEncoder.ERROR_CORRECTION.H, 1425, 864, 593),
            new QRVerToDataSize(27, QRCodeEncoder.ERROR_CORRECTION.L, 3514, 2132, 1465),
            new QRVerToDataSize(27, QRCodeEncoder.ERROR_CORRECTION.M, 2701, 1637, 1125),
            new QRVerToDataSize(27, QRCodeEncoder.ERROR_CORRECTION.Q, 1933, 1172, 805),
            new QRVerToDataSize(27, QRCodeEncoder.ERROR_CORRECTION.H, 1501, 910, 625),
            new QRVerToDataSize(28, QRCodeEncoder.ERROR_CORRECTION.L, 3669, 2223, 1528),
            new QRVerToDataSize(28, QRCodeEncoder.ERROR_CORRECTION.M, 2857, 1732, 1190),
            new QRVerToDataSize(28, QRCodeEncoder.ERROR_CORRECTION.Q, 2085, 1263, 868),
            new QRVerToDataSize(28, QRCodeEncoder.ERROR_CORRECTION.H, 1581, 958, 658),
            new QRVerToDataSize(29, QRCodeEncoder.ERROR_CORRECTION.L, 3909, 2369, 1628),
            new QRVerToDataSize(29, QRCodeEncoder.ERROR_CORRECTION.M, 3035, 1839, 1264),
            new QRVerToDataSize(29, QRCodeEncoder.ERROR_CORRECTION.Q, 2181, 1322, 908),
            new QRVerToDataSize(29, QRCodeEncoder.ERROR_CORRECTION.H, 1677, 1016, 698),
            new QRVerToDataSize(30, QRCodeEncoder.ERROR_CORRECTION.L, 4158, 2520, 1732),
            new QRVerToDataSize(30, QRCodeEncoder.ERROR_CORRECTION.M, 3289, 1994, 1370),
            new QRVerToDataSize(30, QRCodeEncoder.ERROR_CORRECTION.Q, 2358, 1429, 982),
            new QRVerToDataSize(30, QRCodeEncoder.ERROR_CORRECTION.H, 1782, 1080, 742),
            new QRVerToDataSize(31, QRCodeEncoder.ERROR_CORRECTION.L, 4417, 2677, 1840),
            new QRVerToDataSize(31, QRCodeEncoder.ERROR_CORRECTION.M, 3486, 2113, 1452),
            new QRVerToDataSize(31, QRCodeEncoder.ERROR_CORRECTION.Q, 2473, 1499, 1030),
            new QRVerToDataSize(31, QRCodeEncoder.ERROR_CORRECTION.H, 1897, 1150, 790),
            new QRVerToDataSize(32, QRCodeEncoder.ERROR_CORRECTION.L, 4686, 2840, 1952),
            new QRVerToDataSize(32, QRCodeEncoder.ERROR_CORRECTION.M, 3693, 2238, 1538),
            new QRVerToDataSize(32, QRCodeEncoder.ERROR_CORRECTION.Q, 2670, 1618, 1112),
            new QRVerToDataSize(32, QRCodeEncoder.ERROR_CORRECTION.H, 2022, 1226, 842),
            new QRVerToDataSize(33, QRCodeEncoder.ERROR_CORRECTION.L, 4965, 3009, 2068),
            new QRVerToDataSize(33, QRCodeEncoder.ERROR_CORRECTION.M, 3909, 2369, 1628),
            new QRVerToDataSize(33, QRCodeEncoder.ERROR_CORRECTION.Q, 2805, 1700, 1168),
            new QRVerToDataSize(33, QRCodeEncoder.ERROR_CORRECTION.H, 2157, 1307, 898),
            new QRVerToDataSize(34, QRCodeEncoder.ERROR_CORRECTION.L, 5253, 3183, 2188),
            new QRVerToDataSize(34, QRCodeEncoder.ERROR_CORRECTION.M, 4134, 2506, 1722),
            new QRVerToDataSize(34, QRCodeEncoder.ERROR_CORRECTION.Q, 2949, 1787, 1228),
            new QRVerToDataSize(34, QRCodeEncoder.ERROR_CORRECTION.H, 2301, 1394, 958),
            new QRVerToDataSize(35, QRCodeEncoder.ERROR_CORRECTION.L, 5529, 3351, 2303),
            new QRVerToDataSize(35, QRCodeEncoder.ERROR_CORRECTION.M, 4343, 2632, 1809),
            new QRVerToDataSize(35, QRCodeEncoder.ERROR_CORRECTION.Q, 3081, 1867, 1283),
            new QRVerToDataSize(35, QRCodeEncoder.ERROR_CORRECTION.H, 2361, 1431, 983),
            new QRVerToDataSize(36, QRCodeEncoder.ERROR_CORRECTION.L, 5836, 3537, 2431),
            new QRVerToDataSize(36, QRCodeEncoder.ERROR_CORRECTION.M, 4588, 2780, 1911),
            new QRVerToDataSize(36, QRCodeEncoder.ERROR_CORRECTION.Q, 3244, 1966, 1351),
            new QRVerToDataSize(36, QRCodeEncoder.ERROR_CORRECTION.H, 2524, 1530, 1051),
            new QRVerToDataSize(37, QRCodeEncoder.ERROR_CORRECTION.L, 6153, 3729, 2563),
            new QRVerToDataSize(37, QRCodeEncoder.ERROR_CORRECTION.M, 4775, 2894, 1989),
            new QRVerToDataSize(37, QRCodeEncoder.ERROR_CORRECTION.Q, 3417, 2071, 1423),
            new QRVerToDataSize(37, QRCodeEncoder.ERROR_CORRECTION.H, 2625, 1591, 1093),
            new QRVerToDataSize(38, QRCodeEncoder.ERROR_CORRECTION.L, 6479, 3927, 2699),
            new QRVerToDataSize(38, QRCodeEncoder.ERROR_CORRECTION.M, 5039, 3054, 2099),
            new QRVerToDataSize(38, QRCodeEncoder.ERROR_CORRECTION.Q, 3599, 2181, 1499),
            new QRVerToDataSize(38, QRCodeEncoder.ERROR_CORRECTION.H, 2735, 1658, 1139),
            new QRVerToDataSize(39, QRCodeEncoder.ERROR_CORRECTION.L, 6743, 4087, 2809),
            new QRVerToDataSize(39, QRCodeEncoder.ERROR_CORRECTION.M, 5313, 3220, 2213),
            new QRVerToDataSize(39, QRCodeEncoder.ERROR_CORRECTION.Q, 3791, 2298, 1579),
            new QRVerToDataSize(39, QRCodeEncoder.ERROR_CORRECTION.H, 2927, 1774, 1219),
            new QRVerToDataSize(40, QRCodeEncoder.ERROR_CORRECTION.L, 7089, 4296, 2953),
            new QRVerToDataSize(40, QRCodeEncoder.ERROR_CORRECTION.M, 5596, 3391, 2331),
            new QRVerToDataSize(40, QRCodeEncoder.ERROR_CORRECTION.Q, 3993, 2420, 1663),
            new QRVerToDataSize(40, QRCodeEncoder.ERROR_CORRECTION.H, 3057, 1852, 1273),
        };
        #endregion
    }
}
